import request from '@/untils/request'


export const getUserInfo = (params) =>{
  return request({
    url:`/select`,
    method:"GET",
    params
  })
}

export const update = ( data ) => {
  return request({
    url:`/edit`,
    method:'PUT',

    data: data
  })
}


export const realNameAuthentication = (id = null) => {
  return request({
    url:`/realNameAuthentication`,
    method: 'GET',
    params: {
      id: id
    }
  })
}

export const resetUserPassword = ( id ) => {
  return request({
    url: `/updatePassword/${id}`,
    method: 'PUT',
  })
}

export const sendCode = (phone) => {
  return request({
    url: `/sms/sendSms`,
    method: 'POST',
    data: {
      phone: phone
    }
  })
}

export const updateUserPassword = (data) => {
  return request({
    url: `/updateUserPassword`,
    method: `PUT`,
    data:data
  })
}

//查询用户原来的密码
export const selectPassword = (id) => {
  return request({
    url: `/selectPassword/${id}`,
    method: `GET`,
  })
}

export const checkPassword = (id = null,password = null) => {
  return request({
    url: `/checkPassword`,
    method: 'GET',
    params: {
      id: id,
      password: password
    }
  })
}